﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Micro;
using Agnes.Core;

namespace Agnes.TaskManager
{
    /// <summary>
    /// 任务预览树Codon 描述信息
    /// </summary>
    public class TaskSmartTreePad
        :IPadContent
    {
        private static TaskSmartTreeView _taskSmartTreeView;

        private static TaskSmartTreeViewModel _taskSmartTreeViewModel;

        private static TaskSmartTreeView GetTreeView()
        {
            if (_taskSmartTreeView == null)
            {
                _taskSmartTreeView = new TaskSmartTreeView();
                _taskSmartTreeViewModel = new TaskSmartTreeViewModel(TaskManager.Instance);
                ViewModelBinder.Bind(_taskSmartTreeViewModel, _taskSmartTreeView, null);
            }
            return _taskSmartTreeView;
        }

        /// <summary>
        /// 初始化
        /// </summary>
        /// <returns>任务预览树控件</returns>
        public object Intialize()
        {
            return GetTreeView();
        }

        /// <summary>
        /// Codon
        /// </summary>
        public PadDescriptor PadDescriptor { get; set; }

        /// <summary>
        /// Sln关闭
        /// </summary>
        public void SlnClosed()
        {
            
        }

        /// <summary>
        /// Sln重新加载
        /// </summary>
        public void SlnReLoaded()
        {
            
        }

        /// <summary>
        /// 释放资源
        /// </summary>
        public void Dispose()
        {
           
        }
    }
}
